import request from '@/utils/request'

// 玩家管理 模块

// 玩家信息管理
export function playerInfo(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/player/data.auth',
    method: 'post',
    data: formData
  })
}

// 排行信息查询
export function rankInfo(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/rank/data.auth',
    method: 'post',
    data: formData
  })
}

// 玩家数据详情
export function playerDetail(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/player/detail.auth',
    method: 'post',
    data: formData
  })
}

// 封禁玩家
export function blockPlayer(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/playerCurrOnline/forbid.auth',
    method: 'post',
    data: formData
  })
}

// 踢玩家下线
export function KickoutPlayer(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/playerCurrOnline/forcedOffLine.auth',
    method: 'post',
    data: formData
  })
}

// 玩家数据变化明细
export function playerDataChange(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/player/log.auth',
    method: 'post',
    data: formData
  })
}

// 玩家账号切换数据
export function playerSwitch(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/playerSwitch/data.auth',
    method: 'post',
    data: formData
  })
}

// 新增玩家账号切换数据
export function addPlayerSwitch(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/playerSwitch/save.authw',
    method: 'post',
    data: formData
  })
}

// 删除玩家账号切换数据
export function delPlayerSwitch(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/playerSwitch/delete.authw',
    method: 'post',
    data: formData
  })
}

// 作弊日志
export function cheatLog(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/cheatLog/data.auth',
    method: 'post',
    data: formData
  })
}

// 封榜玩家
export function blockListPlayer(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/playerCurrOnline/forbidRank.auth',
    method: 'post',
    data: formData
  })
}

// 英雄列表
export function heroList(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/player/hero.auth',
    method: 'post',
    data: formData
  })
}

// 白名单管理
export function whiteList(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/whiteList/data.auth',
    method: 'post',
    data: formData
  })
}

// 白名单管理
export function AddwhiteList(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/whiteList/add.authw',
    method: 'post',
    data: formData
  })
}

//  白名单管理
export function deletewhiteList(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/whiteList/delete.authw',
    method: 'post',
    data: formData
  })
}


// 封禁IP管理
export function forbidIpList(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/forbidIp/data.auth',
    method: 'post',
    data: formData
  })
}

// 封禁IP管理
export function AddForbidIpList(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/forbidIp/add.authw',
    method: 'post',
    data: formData
  })
}

//  封禁IP管理
export function deleteForbidIpList(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/forbidIp/delete.authw',
    method: 'post',
    data: formData
  })
}